###################################
# IMRO Focus Tree (AI only)       #
# By Augenis                      #
###################################

focus_tree = {
	id = IMRO_focus

	country = {
		factor = 0
		modifier = {
			add = 10
			tag = MAC
		}
	}
	default = no
	continuous_focus_position = { x = 100 y = 950 }

	focus = {
		id = IMRO_war_of_independence
		icon = GFX_goal_SER_macedonia_in_flames
		cost = 4.29

		x = 5
		y = 0

		ai_will_do = { factor = 10 }

		completion_reward = {
			log = "[GetLogRoot]: Focus Completed IMRO_war_of_independence"
		}
		search_filters = { FOCUS_FILTER_POLITICAL }
	}

	focus = {
		id = IMRO_propaganda_of_the_deed
		icon = GFX_focus_focus_fra_revolution_utmost
		cost = 4.29

		relative_position_id = IMRO_war_of_independence
		x = -2
		y = 1

		ai_will_do = { factor = 10 }
		available = {
			NOT = {
				has_country_flag = IMRO_forced_break_focus
			}
		}

		prerequisite = {
			focus = IMRO_war_of_independence
		}

		completion_reward = {
			log = "[GetLogRoot]: Focus Completed IMRO_propaganda_of_the_deed"
			106 = {
				add_resistance = 20
				add_resistance_target = {
					amount = 10
					occupier = SER
					days = 180
					tooltip = SER_IMRO_increase_rt_tt
				}
			}
			hidden_effect = {
				if = {
					limit = {
						SER = { has_completed_focus = SER_instigate_internal_conflict }
					}
					set_country_flag = { flag = IMRO_forced_break_focus days = 30 value = 1 }
				}
			}
		}
		search_filters = { FOCUS_FILTER_POLITICAL }
	}

	focus = {
		id = IMRO_target_commanders
		icon = GFX_goal_generic_officer
		cost = 4.29

		relative_position_id = IMRO_war_of_independence
		x = -3
		y = 2

		ai_will_do = { factor = 10 }
		available = {
			NOT = {
				has_country_flag = IMRO_forced_break_focus
			}
		}

		prerequisite = {
			focus = IMRO_propaganda_of_the_deed
		}

		completion_reward = {
			log = "[GetLogRoot]: Focus Completed IMRO_target_commanders"
			custom_effect_tooltip = IMRO_target_commanders_tt
			hidden_effect = {
				SER = {
					country_event = serbia_events.30
				}
			}
			106 = {
				add_resistance_target = {
					amount = 10
					occupier = SER
					days = 90
					tooltip = SER_IMRO_increase_rt_tt
				}
			}
			hidden_effect = {
				if = {
					limit = {
						SER = { has_completed_focus = SER_instigate_internal_conflict }
					}
					set_country_flag = { flag = IMRO_forced_break_focus days = 30 value = 1 }
				}
			}
		}
		search_filters = { FOCUS_FILTER_POLITICAL }
	}

	focus = {
		id = IMRO_revolutionary_propaganda
		icon = GFX_goal_UKR_contact_diaspora
		cost = 4.29

		relative_position_id = IMRO_war_of_independence
		x = -4
		y = 3

		ai_will_do = { factor = 10 }
		available = {
			NOT = {
				has_country_flag = IMRO_forced_break_focus
			}
		}

		prerequisite = {
			focus = IMRO_target_commanders
		}

		completion_reward = {
			log = "[GetLogRoot]: Focus Completed IMRO_revolutionary_propaganda"
			106 = {
				add_resistance = 10
			}
			add_manpower = 2000
			hidden_effect = {
				if = {
					limit = {
						SER = { has_completed_focus = SER_instigate_internal_conflict }
					}
					set_country_flag = { flag = IMRO_forced_break_focus days = 30 value = 1 }
				}
			}
		}
		search_filters = { FOCUS_FILTER_POLITICAL }
	}

	focus = {
		id = IMRO_sow_chaos
		icon = GFX_focus_generic_tank_destroyer
		cost = 4.29

		relative_position_id = IMRO_war_of_independence
		x = -1
		y = 2

		ai_will_do = { factor = 10 }
		available = {
			NOT = {
				has_country_flag = IMRO_forced_break_focus
			}
		}

		prerequisite = {
			focus = IMRO_propaganda_of_the_deed
		}

		completion_reward = {
			log = "[GetLogRoot]: Focus Completed IMRO_sow_chaos"
			custom_effect_tooltip = IMRO_sow_chaos_tt
			hidden_effect = {
				SER = {
					country_event = serbia_events.28
				}
			}
			hidden_effect = {
				if = {
					limit = {
						SER = { has_completed_focus = SER_instigate_internal_conflict }
					}
					set_country_flag = { flag = IMRO_forced_break_focus days = 30 value = 1 }
				}
			}
		}
		search_filters = { FOCUS_FILTER_POLITICAL }
	}

	focus = {
		id = IMRO_train_bombings
		icon = GFX_goal_generic_seize_railway
		cost = 4.29

		relative_position_id = IMRO_war_of_independence
		x = -2
		y = 3

		ai_will_do = { factor = 10 }
		available = {
			NOT = {
				has_country_flag = IMRO_forced_break_focus
			}
		}

		prerequisite = {
			focus = IMRO_sow_chaos
		}
		prerequisite = {
			focus = IMRO_target_commanders
		}

		completion_reward = {
			log = "[GetLogRoot]: Focus Completed IMRO_train_bombings"
			if = {
				limit = {
					NOT = {
						SER = {
							has_completed_focus = SER_railroad_transport_groups
						}
					}
				}
				custom_effect_tooltip = IMRO_train_bombings_tt
				hidden_effect = {
					106 = {
						add_dynamic_modifier = { modifier = SER_IMRO_spawned_resistance }
					}
				}
			}
			hidden_effect = {
				if = {
					limit = {
						SER = { has_completed_focus = SER_instigate_internal_conflict }
					}
					set_country_flag = { flag = IMRO_forced_break_focus days = 30 value = 1 }
				}
			}
		}
		search_filters = { FOCUS_FILTER_POLITICAL }
	}

	focus = {
		id = IMRO_study_their_tactics
		icon = GFX_goal_generic_plotting
		cost = 4.29

		relative_position_id = IMRO_war_of_independence
		x = -3
		y = 4

		ai_will_do = { factor = 10 }

		prerequisite = {
			focus = IMRO_train_bombings
		}
		mutually_exclusive = {
			focus = IMRO_one_step_ahead
		}
		available = {
			OR = {
				SER = {
					has_completed_focus = SER_lure_strategy
				}
				SER = {
					has_completed_focus = SER_destruction_strategy
				}
			}
			NOT = {
				has_country_flag = IMRO_forced_break_focus
			}
		}

		completion_reward = {
			log = "[GetLogRoot]: Focus Completed IMRO_study_their_tactics"
			custom_effect_tooltip = IMRO_study_their_tactics_tt
			hidden_effect = {
				if = {
					limit = {
						SER = { has_completed_focus = SER_instigate_internal_conflict }
					}
					set_country_flag = { flag = IMRO_forced_break_focus days = 30 value = 1 }
				}
			}
		}
		search_filters = { FOCUS_FILTER_POLITICAL }
	}

	focus = {
		id = IMRO_one_step_ahead
		icon = GFX_goal_generic_lightbulb
		cost = 4.29

		relative_position_id = IMRO_war_of_independence
		x = -1
		y = 4

		ai_will_do = { factor = 10 }

		prerequisite = {
			focus = IMRO_train_bombings
		}
		mutually_exclusive = {
			focus = IMRO_study_their_tactics
		}
		available = {
			NOT = {
				OR = {
					SER = {
						has_completed_focus = SER_lure_strategy
					}
					SER = {
						has_completed_focus = SER_destruction_strategy
					}
				}
			}
			NOT = {
				has_country_flag = IMRO_forced_break_focus
			}
		}

		completion_reward = {
			log = "[GetLogRoot]: Focus Completed IMRO_one_step_ahead"
			custom_effect_tooltip = IMRO_one_step_ahead_tt
			hidden_effect = {
				if = {
					limit = {
						SER = { has_completed_focus = SER_instigate_internal_conflict }
					}
					set_country_flag = { flag = IMRO_forced_break_focus days = 30 value = 1 }
				}
			}
		}
		search_filters = { FOCUS_FILTER_POLITICAL }
	}

	focus = {
		id = IMRO_occupy_pirin
		icon = GFX_goal_generic_expel_people
		cost = 4.29

		relative_position_id = IMRO_war_of_independence
		x = 2
		y = 1

		ai_will_do = { factor = 10 }
		available = {
			NOT = {
				has_country_flag = IMRO_forced_break_focus
			}
		}
		bypass = {
			212 = {
				NOT = {
					is_owned_by = BUL
				}
			}
		}

		prerequisite = {
			focus = IMRO_war_of_independence
		}

		completion_reward = {
			log = "[GetLogRoot]: Focus Completed IMRO_occupy_pirin"
			BUL = {
				country_event = serbia_events.29
			}
			custom_effect_tooltip = IMRO_occupy_pirin_tt
			hidden_effect = {
				212 = {
					add_dynamic_modifier = { modifier = SER_IMRO_occupation_of_pirin }
				}
				activate_mission = SER_IMRO_weapons_from_bulgaria
			}
			hidden_effect = {
				if = {
					limit = {
						SER = { has_completed_focus = SER_instigate_internal_conflict }
					}
					set_country_flag = { flag = IMRO_forced_break_focus days = 30 value = 1 }
				}
			}
		}
		search_filters = { FOCUS_FILTER_ARMY_BONUS }
	}

	focus = {
		id = IMRO_establish_legal_system
		icon = GFX_focus_spr_torchbearers_of_tomorrow
		cost = 4.29

		relative_position_id = IMRO_war_of_independence
		x = 1
		y = 2

		ai_will_do = { factor = 10 }
		available = {
			NOT = {
				has_country_flag = IMRO_forced_break_focus
			}
		}

		prerequisite = {
			focus = IMRO_occupy_pirin
		}

		completion_reward = {
			log = "[GetLogRoot]: Focus Completed IMRO_establish_legal_system"
			custom_effect_tooltip = IMRO_establish_legal_system_tt
			hidden_effect = {
				if = {
					limit = {
						SER = { has_completed_focus = SER_instigate_internal_conflict }
					}
					set_country_flag = { flag = IMRO_forced_break_focus days = 30 value = 1 }
				}
			}
		}
		search_filters = { FOCUS_FILTER_ARMY_BONUS }
	}

	focus = {
		id = IMRO_taxation_system
		icon = GFX_goal_generic_seize_money
		cost = 4.29

		relative_position_id = IMRO_war_of_independence
		x = 0
		y = 3

		ai_will_do = { factor = 10 }
		available = {
			NOT = {
				has_country_flag = IMRO_forced_break_focus
			}
		}

		prerequisite = {
			focus = IMRO_establish_legal_system
		}
		prerequisite = {
			focus = IMRO_sow_chaos
		}

		completion_reward = {
			log = "[GetLogRoot]: Focus Completed IMRO_taxation_system"
			swap_ideas = {
				remove_idea = IMRO_idea
				add_idea = IMRO_idea_2
			}
			hidden_effect = {
				if = {
					limit = {
						SER = { has_completed_focus = SER_instigate_internal_conflict }
					}
					set_country_flag = { flag = IMRO_forced_break_focus days = 30 value = 1 }
				}
			}
		}
		search_filters = { FOCUS_FILTER_INDUSTRY }
	}

	focus = {
		id = IMRO_regimental_organization
		icon = GFX_focus_generic_manpower
		cost = 4.29

		relative_position_id = IMRO_war_of_independence
		x = 1
		y = 4

		ai_will_do = { factor = 10 }
		available = {
			NOT = {
				has_country_flag = IMRO_forced_break_focus
			}
		}

		prerequisite = {
			focus = IMRO_taxation_system
		}

		completion_reward = {
			log = "[GetLogRoot]: Focus Completed IMRO_regimental_organization"
			custom_override_tooltip = {
				tooltip = {
					localization_key = tooltip_create_division_template
					NAME = "VMRO Diviziya"
					LINE_1 = { localization_key = line_battalion_tt NAME = infantry ICON = GFX_unit_infantry_icon_small COUNT = 7 }
					SUPPORT_1 = { localization_key = support_battalion_tt NAME = recon ICON = GFX_unit_recon_icon_small }
					SUPPORT_2 = { localization_key = support_battalion_tt NAME = engineer ICON = GFX_unit_engineer_icon_small }
				}
				if = {
					limit = { has_template = "VMRO Diviziya" }
					delete_unit_template_and_units = { division_template = "VMRO Diviziya" disband = yes }
				}
				division_template = {
					name = "VMRO Diviziya"
					division_names_group = MAC_MIL_01
					is_locked = yes
					regiments = {
						infantry = { x = 0 y = 0 }
						infantry = { x = 0 y = 1 }
						infantry = { x = 0 y = 2 }
						infantry = { x = 0 y = 3 }
						infantry = { x = 1 y = 0 }
						infantry = { x = 1 y = 1 }
						infantry = { x = 1 y = 2 }
					}
					support = {
						recon = { x = 0 y = 0 }
						engineer = { x = 0 y = 1 }
					}
				}
			}
			hidden_effect = {
				if = {
					limit = {
						SER = { has_completed_focus = SER_instigate_internal_conflict }
					}
					set_country_flag = { flag = IMRO_forced_break_focus days = 30 value = 1 }
				}
			}
		}
		search_filters = { FOCUS_FILTER_ARMY_BONUS }
	}

	focus = {
		id = IMRO_kuusou_mesorogiwi
		icon = GFX_goal_generic_barricades
		cost = 4.29

		relative_position_id = IMRO_war_of_independence
		x = 3
		y = 4

		ai_will_do = { factor = 10 }
		available = {
			NOT = {
				has_country_flag = IMRO_forced_break_focus
			}
		}

		prerequisite = {
			focus = IMRO_taxation_system
		}

		completion_reward = {
			log = "[GetLogRoot]: Focus Completed IMRO_kuusou_mesorogiwi"
			add_ideas = IMRO_kuusou_mesorogiwi_idea
			hidden_effect = {
				if = {
					limit = {
						SER = { has_completed_focus = SER_instigate_internal_conflict }
					}
					set_country_flag = { flag = IMRO_forced_break_focus days = 30 value = 1 }
				}
			}
		}
		search_filters = { FOCUS_FILTER_ARMY_BONUS }
	}

	focus = {
		id = IMRO_freedom_or_death
		icon = GFX_goal_HOL_fires_of_revolution_faux
		cost = 4.29

		relative_position_id = IMRO_war_of_independence
		x = 2
		y = 5

		ai_will_do = { factor = 10 }
		available = {
			NOT = {
				has_country_flag = IMRO_forced_break_focus
			}
		}

		prerequisite = {
			focus = IMRO_kuusou_mesorogiwi
		}
		prerequisite = {
			focus = IMRO_regimental_organization
		}

		completion_reward = {
			log = "[GetLogRoot]: Focus Completed IMRO_freedom_or_death"
			swap_ideas = {
				remove_idea = IMRO_idea_2
				add_idea = IMRO_idea_3
			}
			hidden_effect = {
				if = {
					limit = {
						SER = { has_completed_focus = SER_instigate_internal_conflict }
					}
					set_country_flag = { flag = IMRO_forced_break_focus days = 30 value = 1 }
				}
			}
		}
		search_filters = { FOCUS_FILTER_ARMY_BONUS }
	}

	focus = {
		id = IMRO_appeal_for_aid
		icon = GFX_BUL_bulgarian_army
		cost = 4.29

		relative_position_id = IMRO_war_of_independence
		x = 3
		y = 2

		ai_will_do = { factor = 10 }
		available = {
			NOT = {
				has_country_flag = IMRO_forced_break_focus
			}
		}
		bypass = {
			212 = {
				NOT = {
					is_owned_by = BUL
				}
			}
		}

		prerequisite = {
			focus = IMRO_occupy_pirin
		}

		completion_reward = {
			log = "[GetLogRoot]: Focus Completed IMRO_appeal_for_aid"
			custom_effect_tooltip = IMRO_appeal_for_aid_tt
			hidden_effect = {
				if = {
					limit = {
						SER = { has_completed_focus = SER_instigate_internal_conflict }
					}
					set_country_flag = { flag = IMRO_forced_break_focus days = 30 value = 1 }
				}
			}
		}
		search_filters = { FOCUS_FILTER_ARMY_BONUS }
	}

	focus = {
		id = IMRO_komitadzii_detachments
		icon = GFX_goal_refugee_management
		cost = 4.29

		relative_position_id = IMRO_war_of_independence
		x = 2
		y = 3

		ai_will_do = { factor = 10 }
		available = {
			NOT = {
				has_country_flag = IMRO_forced_break_focus
			}
		}

		prerequisite = {
			focus = IMRO_occupy_pirin
		}

		completion_reward = {
			log = "[GetLogRoot]: Focus Completed IMRO_komitadzii_detachments"
			enable_tech_mountain_warfare = yes
			custom_override_tooltip = {
				tooltip = {
					localization_key = tooltip_create_division_template
					NAME = "Komitadžii Detachment"
					LINE_1 = { localization_key = line_battalion_tt NAME = mountaineers ICON = GFX_unit_mountaineers_icon_small COUNT = 5 }
				}
				if = {
					limit = { has_template = "Komitadžii Detachment" }
					delete_unit_template_and_units = { division_template = "Komitadžii Detachment" disband = yes }
				}
				division_template = {
					name = "Komitadžii Detachment"
					division_names_group = MAC_MIL_01
					regiments = {
						mountaineers = { x = 0 y = 0 }
						mountaineers = { x = 0 y = 1 }
						mountaineers = { x = 1 y = 0 }
						mountaineers = { x = 1 y = 1 }
						mountaineers = { x = 1 y = 2 }
					}
				}
			}
			hidden_effect = {
				if = {
					limit = {
						SER = { has_completed_focus = SER_instigate_internal_conflict }
					}
					set_country_flag = { flag = IMRO_forced_break_focus days = 30 value = 1 }
				}
			}
		}
		search_filters = { FOCUS_FILTER_ARMY_BONUS }
	}
}

